package com.power;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;


@SpringBootApplication
@EntityScan(basePackages = {"com.power.base",  "com.power.project"})
@EnableJpaRepositories(basePackages = {"com.power.base",  "com.power.project"})
@ComponentScan(basePackages = {"com.power.base", "com.power.common", "com.power.project"})
public class OfficemanageServiceApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(OfficemanageServiceApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        String port = environment.getProperty("server.port");
        String path = environment.getProperty("server.servlet.context-path");
        System.out.println(String.format("\n------ 企信通服务端启动成功 http://localhost:%s%s/ ------------", port, path));
    }

}
